/*
 * @Description:
 * @Author: qingyang
 * @Date: 2023-06-08 17:17:18
 * @LastEditors: qingyang
 * @LastEditTime: 2023-06-09 17:20:36
 */
import { ProcessDefinitionKeyEnum } from '@/constants/enum';

export interface ITaskResult {
  businessKey: string;
  processInstanceId: string;
  processDefinitionKey: string;
  processInstanceTitle: string;
  startUserId: string;
  startUser: string;
  startTime: string;
  assignee: string;
  currentTaskId: string;
  currentTaskName: string;
  rejectNum: number;
}

export interface IFlowHistoryItem {
  activityId: string;
  activityName: string;
  action: string;
  actionDesc: string;
  actionComment: string;
  startTime: string;
  endTime: string;
  costTime: string;
  actionUserName: string;
  containSubInstance: string;
}

export interface IProcessInfo {
  processInstanceId: string;
  processDefinitionName: string;
  businessKey: string;
  businessName: string;
  startTime: string;
  endTime: string;
  starter: string;
  starterEmail: string;
  starterEnterprise: string;
  processDefinitionKey: keyof typeof ProcessDefinitionKeyEnum;
  // 任务的定义KEY
  taskDefinitionKey?: string;
  // 流程实例节点状态
  processInstanceStatus: string;
  // 驳回原因
  rejectComment: string;
}

/**
 * 流程按钮 返回值
 */
export interface GetListFlowButtonResult {
  /**
   * 流程定义Id
   */
  processDefinitionId: string;
  /**
   * 流程实例Id
   */
  processInstanceId: string;
  /**
   * 任务ID
   */
  taskId: string;
  /**
   * 业务key
   */
  businessKey: string;
  /**
   * 动作
   */
  action: string;
  /**
   * 动作名称
   */
  actionName: string;
  /**
   * 执行Id
   */
  executionId: string;
  /**
   * 排序
   */
  order: number;
  /**
   * 是否需要意见
   */
  needComment: boolean;
  /**
   * 是否需要校验表单（通常用于保存和提交的区分）
   */
  needValidForm: boolean | null;
  /**
   * 按钮类型
   */
  buttonType: 'PRIMARY' | 'DEFAULT' | 'DANGER';
  /**
   * 是否推进任务，默认推进任务
   */
  completeTask: boolean | null;
}

/**
 * 任务提交 入参
 */
export interface PostCompleteUserTaskParams {
  /**
   * 操作
   */
  action: string;
  /**
   * 操作意见(审批意见)
   */
  actionComment: string;
  /**
   * 任务ID
   */
  taskId: string;
  /**
   * 流程实例ID
   */
  processInstanceId: string;
  /**
   * 驳回至指定任务节点ID（预留）
   */
  rejectTo?: string;
  /**
   * 业务主键
   */
  businessKey?: string;
  /**
   * 审批业务参数
   */
  businessParams?: any;
  /**
   * 是否推进任务，默认推进任务
   */
  completeTask: boolean;
}

/**
 * 获取技术支持人员名单 返回参数
 */
export interface GetSupportPersonnelResult {
  /**
   * 姓名
   */
  realName: string;
  /**
   * 联系电话
   */
  phone: string;
  /**
   * 联系邮箱
   */
  email: string;
}
